package com.tang.framework.config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author tang jun liang
 * @Date 2023/4/20 16:22
 */

public class SpringApplication  {

    public static ApplicationContext applicationContext;





    public static <T> T getBean(Class<T> clazz) {
        return applicationContext.getBean(clazz);
    }


    public static <T> T getBean(String benName) {
        return (T) applicationContext.getBean(benName);
    }


    public static <T> T getBean(String benName, Class<T> clazz) {
        return (T) applicationContext.getBean(benName, clazz);
    }

}
